package cn.edu.scau.dropship.ServiceImpl;

import cn.edu.scau.dropship.entity.Goods;
import cn.edu.scau.dropship.entity.Wish_goodsExample;
import cn.edu.scau.dropship.entity.Wish_goodsKey;
import cn.edu.scau.dropship.mapper.Wish_goodsMapper;
import cn.edu.scau.dropship.service.WishGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WishGoodsServiceImpl implements WishGoodsService {
    @Autowired
    private Wish_goodsMapper wish_goodsMapper;

    @Override
    public long countByExample(Wish_goodsExample example) {
        return wish_goodsMapper.countByExample(example);
    }

    @Override
    public int deleteByExample(Wish_goodsExample example) {
        return wish_goodsMapper.deleteByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(Wish_goodsKey key) {
        return wish_goodsMapper.deleteByPrimaryKey(key);
    }

    @Override
    public int insert(Wish_goodsKey record) {
        return wish_goodsMapper.insert(record);
    }

    @Override
    public int insertSelective(Wish_goodsKey record) {
        return wish_goodsMapper.insertSelective(record);
    }

    @Override
    public List<Wish_goodsKey> selectByExample(Wish_goodsExample example) {
        return wish_goodsMapper.selectByExample(example);
    }

    @Override
    public int updateByExampleSelective(Wish_goodsKey record, Wish_goodsExample example) {
        return wish_goodsMapper.updateByExampleSelective(record, example);
    }

    @Override
    public int updateByExample(Wish_goodsKey record, Wish_goodsExample example) {
        return wish_goodsMapper.updateByExample(record, example);
    }

    @Override
    public List<Wish_goodsKey> selectByWid(Integer wid) {
        Wish_goodsExample wish_goodsExample=new Wish_goodsExample();
        Wish_goodsExample.Criteria criteria=wish_goodsExample.createCriteria();
        criteria.andWishIdEqualTo(wid);
        List<Wish_goodsKey> list=wish_goodsMapper.selectByExample(wish_goodsExample);
        return list;
    }
}
